import React from 'react';
import ReactDOM from 'react-dom';
import Child from './child'
class App extends React.Component {
  state = {
    list: [1, 2, 3, 4, 5]
  }
  change = (arr) => {
    this.setState({
      list: arr
    })
    console.log(this)
  }
  // ref 获取组件 只能获取类组件 不能获取函数式组件
  render() {
    let { list } = this.state
    return <div className=''>
      <Child
        ref={el => this.qq = el}
        list={list}
        qq={123}
        change={this.change} />
    </div>;
  }
}

ReactDOM.render(<App />, document.getElementById('root'))